package com.dz.tool.Service.Impl.quartz;

import com.dz.tool.Service.OracleServer;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

import javax.annotation.Resource;
import java.util.*;

public class DayOneJob implements Job {

    @Resource
    OracleServer oracleServer;

    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        System.out.println("每天凌晨一点执行一次定时任务开始"+new Date());

        List<Map<String,String>> OracleTableList = new ArrayList<>();

        // 备份库 --》中转
        System.out.println("备份库 --》中转");
        YX(OracleTableList);
        DZ(OracleTableList);
        LP(OracleTableList);
        CB(OracleTableList);
        ZH(OracleTableList);
        oracleServer.OracleToOracleIncrementTableList2(OracleTableList);

        System.out.println("每天凌晨一点执行一次定时任务结束"+new Date());
    }

    public void YX(List<Map<String,String>> OracleTableList){
        Map<String,String> table = new HashMap<>();

        // CB

        // LP
        table = new HashMap<>();
        table.put("table","WEB_CLM_RPT_REMARKS");
        table.put("id","C_PK_ID");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_CLM_FEELIST_ADJUST");
        table.put("id","C_ADJUSTFEE_PK_ID");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);


        // DZ
        table = new HashMap<>();
        table.put("table","WEB_VCH_BASE");
        table.put("id","C_PK_ID");
        table.put("way","increment");
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_VCH_PRNEXPEND");
        table.put("id","C_PK_ID");
        table.put("way","increment");
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

    }

    // ZH
    public void ZH(List<Map<String,String>> OracleTableList){
        Map<String,String> table = new HashMap<>();

        // CB
        table = new HashMap<>();
        table.put("table","WEB_PLY_FEE");
        table.put("id","C_PK_ID");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_PLY_PAY");
        table.put("id","C_PK_ID");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

    }

    // 理赔
    public void LP(List<Map<String,String>> OracleTableList){
        Map<String,String> table = new HashMap<>();

        table = new HashMap<>();
        table.put("table","WEB_CLM_DSPT");
        table.put("id","C_DSPT_PK_ID");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_CLM_DSPT_DTL");
        table.put("id","C_DSPTDTL_PK_ID");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_CLM_ACCDNT");
        table.put("id","C_INS_ACC_PK_ID");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_CLM_GUIDE_VIEW");
        table.put("id","C_GUIDE_ID");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);


        table = new HashMap<>();
        table.put("table","WEB_CLM_RPT");
        table.put("id","C_CLM_NO");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_CLM_BACK_CONCLU");
        table.put("id","C_BACK_CONCLU_PK_ID");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_CLMNV_RGST");
        table.put("id","C_PK_RGST_ID");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_CLM_ENTRUST");
        table.put("id","C_ENTRUST_PK_ID");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_CLM_MAIN");
        table.put("id","C_CASE_NO");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        table.put("n_table","WEB_CLM_MAIN_END");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_CLM_MAIN");
        table.put("id","C_CASE_NO");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);


        table = new HashMap<>();
        table.put("table","WEB_CLM_BUSBANK");
        table.put("id","C_BANK_ID");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_CLM_ACCDNT_RESULT");
        table.put("id","C_PK_ID");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_CLM_ESTMT");
        table.put("id","C_ESTMT_PK_ID");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_CLM_BACK_CONCLU_OPIN");
        table.put("id","C_BACK_CONCLU_OPIN_PK_ID");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_CLM_COINAPPO");
        table.put("id","C_COINAPPO_PK_ID");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_CLMNV_SRVY");
        table.put("id","C_SRVY_PK_ID");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_CLM_CANCEL");
        table.put("id","C_CANCEL_PK_ID");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_CLM_RENEW");
        table.put("id","C_CANCEL_PK_ID");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_CLM_END_CASE_DTL");
        table.put("id","C_PK_ID");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_CLM_TEL_CANCEL");
        table.put("id","C_CLM_NO");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_CANCEL_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_CLM_RECOVER_ENDCASE");
        table.put("id","C_RECO_ENDCASE_PK_ID");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_CLM_PURSUING_OF_RECOVERY");
        table.put("id","C_REASON_ID");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_CLM_RECOVER_RGST");
        table.put("id","C_RECOVER_NO");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_CLM_ADJUST");
        table.put("id","C_ADJUST_PK_ID");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_CLM_BANK");
        table.put("id","C_BANK_ID");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_CLM_CHECKCLM_OPIN");
        table.put("id","C_CHKCLMOPIN_PK_ID");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_CLM_REOPEN");
        table.put("id","C_REOPEN_PK_ID");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_CLMNV_ENDCASE");
        table.put("id","C_ENDCASE_PK_ID");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_CLM_PEND");
        table.put("id","C_PEND_ID");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_CLM_TIMEINFO");
        table.put("id","C_TIMEINFO_PK_ID");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_CLM_IMAGE");
        table.put("id","C_IMAGE_PK_ID");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","ZJ_BANK_TOPCLASS");
        table.put("id","");
        table.put("way","all");  // increment || all
        table.put("inc_field","");
        OracleTableList.add(table);


        table = new HashMap<>();
        table.put("table","ZJ_BANKAREACODE");
        table.put("id","N_ID");
        table.put("way","all");  // increment || all
        table.put("inc_field","DT_MODIFYTIME");
        OracleTableList.add(table);


        table = new HashMap<>();
        table.put("table","ZJ_BANKNAMEANDCODE");
        table.put("id","N_ID");
        table.put("way","all");  // increment || all
        table.put("inc_field","");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_CLM_PEND_DTL");
        table.put("id","C_PEND_DTL_ID");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);


        table = new HashMap<>();
        table.put("table","WEB_CLM_CHECKCLM");
        table.put("id","C_CHKCLM_PK_ID");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_CLMNV_PREPAY");
        table.put("id","C_PREPAY_PK_ID");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_CLM_DOCINFO");
        table.put("id","C_DOCINFO_PK_ID");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

    }

    // 承保
    public void CB(List<Map<String,String>> OracleTableList){
        Map<String,String> table = new HashMap<>();

        table = new HashMap<>();
        table.put("table","WEB_PLY_BNFC");
        table.put("id","C_PK_ID");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_PLY_INSURED");
        table.put("id","C_PK_ID");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_PLY_APPLICANT");
        table.put("id","C_APP_NO");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);


        table = new HashMap<>();
        table.put("table","WEB_PLY_ACCTINFO");
        table.put("id","C_APP_NO");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_PLY_CI");
        table.put("id","C_PK_ID");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_PLY_ENT_TGT");
        table.put("id","C_PK_ID");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_PLY_BASE");
        table.put("id","C_APP_NO");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_EDR_CMP_ITEM");
        table.put("id","C_PK_ID");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_POS_FRONT_TRUNC");
        table.put("id","C_PK_ID");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_PLY_RISK_QUST");
        table.put("id","C_APP_NO");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_PLY_TGT");
        table.put("id","C_APP_NO");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_UNDR_OPN");
        table.put("id","C_PK_ID");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_PAY_CONFIRM_INFO");
        table.put("id","C_UNIQUE_NO");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_PLY_AGRO");
        table.put("id","C_APP_NO");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_PLY_CARGO_LIST");
        table.put("id","C_PK_ID");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_PLY_CARGO");
        table.put("id","C_APP_NO");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_PLY_IMG_IDX");
        table.put("id","C_IMG_ID");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_INTERFACE_POLL");
        table.put("id","C_PK_ID");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_ILOG_FEE_INFO");
        table.put("id","C_APP_NO");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","MM_CHARGEDETAIL_TI");
        table.put("id","ID");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_PLY_PRJ_REL");
        table.put("id","C_PK_ID");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","MM_POLICY_TI");
        table.put("id","ID");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","MM_PAY_PLAN_TI");
        table.put("id","ID");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","MM_POLICYLIST_TI");
        table.put("id","ID");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_PLY_TGT_OBJ");
        table.put("id","C_PK_ID");
        table.put("way","increment");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

    }

    // 单证
    public void DZ(List<Map<String,String>> OracleTableList){
        Map<String,String> table = new HashMap<>();

        table = new HashMap<>();
        table.put("table","WEB_VCH_APP");
        table.put("id","C_APP_ID");
        table.put("way","increment");
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_VCH_APP_OPIN");
        table.put("id","C_PK_ID");
        table.put("way","increment");
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_VCH_OPERLOG");
        table.put("id","C_PK_ID");
        table.put("way","increment");
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_VCH_TYPEINFO");
        table.put("id","C_PK_ID");
        table.put("way","increment");
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_VCH_PRNBATCH");
        table.put("id","C_PK_ID");
        table.put("way","increment");
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);


        table = new HashMap<>();
        table.put("table","WEB_VCH_APP_STORAGE");
        table.put("id","C_PK_ID");
        table.put("way","increment");
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_PRNVCH_MAP");
        table.put("id","C_PK_ID");
        table.put("way","increment");
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_VCH_TRANSDPTMAP");
        table.put("id","C_PK_ID");
        table.put("way","increment");
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_VCH_TRANSTASK");
        table.put("id","C_PK_ID");
        table.put("way","increment");
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_VCH_OP_SET");
        table.put("id","C_PK_ID");
        table.put("way","increment");
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_VCH_APP_ADJUST");
        table.put("id","C_PK_ID");
        table.put("way","increment");
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_VCH_APP_INFO");
        table.put("id","C_PK_ID");
        table.put("way","increment");
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_VCH_MAIN_ORDER");
        table.put("id","C_PK_ID");
        table.put("way","increment");
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_VCH_CONTROL");
        table.put("id","C_PK_ID");
        table.put("way","increment");
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);


        table = new HashMap<>();
        table.put("table","WEB_VCH_PGHLIST");
        table.put("id","C_PK_ID");
        table.put("way","increment");
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_PRN_TYPE");
        table.put("id","C_PRN_TYPE");
        table.put("way","increment");
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_PRN_FMP");
        table.put("id","C_PRN_FMP");
        table.put("way","increment");
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_VCH_TYPE");
        table.put("id","C_VCH_TYPE");
        table.put("way","increment");
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_VCH_PRICE");
        table.put("id","C_PRICE_VERSION");
        table.put("way","increment");
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_VCH_PGHLIST_DTL");
        table.put("id","C_PK_ID");
        table.put("way","increment");
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table", "WEB_PRN_INFO");
        table.put("id", "C_PK_ID");
        table.put("way", "increment");
        table.put("inc_field", "T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_VCH_PGH");
        table.put("id","C_PGH_NO");
        table.put("way","increment");
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);

        table = new HashMap<>();
        table.put("table","WEB_SYS_STA_DICT");
        table.put("id","C_PK_ID");
        table.put("way","all");  // increment || all
        table.put("inc_field","T_UPD_TM");
        OracleTableList.add(table);


    }

}
